<?php

namespace app\common\model\biz;

use app\common\model\BaseModel;
use think\facade\Config;
use think\model\concern\SoftDelete;

class SysUser extends BaseModel
{
    use SoftDelete;

    protected string $deleteTime = 'delete_time';


    public static function encryptPassword($password, $salt = 'jon-cc'): string
    {
        $sysSalt = Config::get('encrypt.sys_salt');
        if (empty($sysSalt)) {
            $sysSalt = $salt;
        }

        return md5(md5($password) . $sysSalt);
    }
}